<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>Title</title>
</head>
<body>
	<script>
		let print1 = function (obj) {
			console.log(obj);
		}
		print1('abc');
		//简写为：
		let print2 = obj => console.log(obj);
		print2('abc');
		let sum1 = function (a, b) {
			return a + b;
		}
		let sum2 = (a, b) => {
			return a + b;
		}
		let sum3 = (a, b) => a + b;
		console.log(sum3(3,5));

		let person = {
			name: 'jack',
			eat1: function (food) {
				console.log(this.name + '正在吃' + food);
			},
			eat2: food => console.log(person.name + '正在吃' + food),
			eat3(food) {
				console.log(this.name + '正在吃' + food);
			}
		}

		person.eat2('apple');
		person.eat3('xxx');


	</script>
</body>
</html>